package ru.xpparty.scanner;

/**
 * POJOs result of scanning process
 * 
 * @author xp.party
 *
 */
public class ScanResult {
    private String host;
    private StringBuffer report = new StringBuffer();

    /**
     * Constructs new scan result for given host
     * 
     * @param host given host to scan
     */
    public ScanResult(String host) {
        this.host = host;
    }   

    /**
     * Appends information about status of given port
     * in final report
     * 
     * @param port given port
     * @param status status of given port
     */
    public void append(int port, PortStatus status) {
        report.append(String.format("%s:%d %s\n", host, port, status));
    }
    
    @Override
    public String toString() {
        return report.toString();
    }
}
